package com.vfa.vocaburay;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Result extends Activity {

	// private WordData wordData;
	private Button total;
	private Button wrong;
	private Button right;
	private Button newQuiz;
	private Button vfaMainbtt;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.resultlayout);
		// wordData = new WordData(getApplicationContext());
		total = (Button) findViewById(R.id.totalButton);
		wrong = (Button) findViewById(R.id.wrongButton);
		right = (Button) findViewById(R.id.rightButton);
		newQuiz = (Button) findViewById(R.id.newQuizButton);
		newQuiz.setOnClickListener(newQuiz_listener);

		Bundle result = getIntent().getExtras();
		int totalQuestion = result.getInt("totalQuestion");
		int rightAnwser = result.getInt("rightQuestion");
		int wrongAnwser = totalQuestion - rightAnwser;

		total.setText("Total question: " + totalQuestion);
		total.setTextColor(Color.WHITE);
		right.setText("You scored: " + rightAnwser + " points");
		right.setTextColor(Color.WHITE);
		wrong.setText("Wrong anwsers: " + wrongAnwser);
		wrong.setTextColor(Color.WHITE);
	}

	private OnClickListener newQuiz_listener = new OnClickListener() {

		@Override
		public void onClick(View v) {
			Intent intent = new Intent(Result.this, QuizOption.class);
			startActivity(intent);
			Result.this.finish();
		}
	};

}
